from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase = "DBshop010"

firefox = openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu2(firefox,'销售管理','退货管理')
a=firefox.find_element_by_xpath('//tbody/tr[2]/td[6]/a[1]').click()
firefox.find_element_by_id("refund_price").send_keys('2199')
firefox.find_element_by_id("re_refund_info").send_keys('同意退货')
firefox.find_element_by_xpath('//button[text()="提交处理结果"]').click()

openBrowser(url)
DBshopLogin(firefox,'yuqilin','123456')
firefox.find_element_by_link_text('用户中心').click()
firefox.find_element_by_link_text('退货申请').click()

a=firefox.find_element_by_xpath('//tbody/tr[1]/td[4]').text

try:
    a=='退款成功'
    writeLog('%s 测试通过'%testCase)
except:
    writeLog('$ 测试失败'%testCase)

firefox.quit()